﻿using System;
using System.Collections.Generic;
using System.Text;
using Pay.TO;

namespace Pay.DTO {
	/// <summary>
	/// 平台账单明细表：mc_PlatBillDetail
	/// </summary>
	[Serializable]
	public class plat_bill_detail_dto {
		public plat_bill_detail_dto() {
		}

		/// <summary>
		/// 分类id
		/// </summary>
		public long id { get; set; }
		/// <summary>
		/// 账单id
		/// </summary>
		public long plat_bill_id { get; set; }
		/// <summary>
		/// 可能订单id,退款id,提现id
		/// </summary>
		public long? object_id { get; set; }
		/// <summary>
		/// 账单类型
		/// </summary>
		public BillType bill_type { get; set; }
		/// <summary>
		/// 账单类型
		/// </summary>
		public string type_name {
			get {
				string str = string.Empty;
				switch (bill_type) {
					case BillType.Receipt: str = "收款"; break;
					case BillType.Fee: str = "费率成本"; break;
					case BillType.Refund: str = "退款"; break;
					case BillType.RefundFee: str = "退回手续费"; break;
					case BillType.Deposit: str = "提现"; break;
					case BillType.OemIntTradeFee: str = "积分手续费"; break;
					case BillType.Subsidy: str = "补粘"; break;
					case BillType.IntPay: str = "积分支付"; break;
					case BillType.FeeProfit: str = "费率分润"; break;
					case BillType.SettleProfit: str = "结算分润"; break;
					case BillType.UpProfit: str = "升级分润"; break;
					case BillType.Mall: str = "货款"; break;
					case BillType.OemTradeFee: str = "商品手续费"; break;
					case BillType.Distribution: str = "分销"; break;
					case BillType.Outpay: str = "充值代付"; break;
				}
				return str;
			}
		}
		/// <summary>
		/// 金额
		/// </summary>
		public decimal amount { get; set; }
		/// <summary>
		/// 余额
		/// </summary>
		public decimal balance { get; set; }
		/// <summary>
		/// 状态：1进行中(收入待确认、退款中、提现申请)，2完成，3失败
		/// <para>相对billtype，收款：1待发货，2完成；</para>
		/// <para>提现：1提现中，2完成</para>
		/// <para>退款：1待退款，2完成，3失败</para>
		/// <para>支付：2完成</para>
		/// </summary>
		public BillStatus status { get; set; }
		/// <summary>
		/// 状态名称
		/// </summary>
		public string status_name {
			get {
				string str = string.Empty;
				switch (status) {
					case BillStatus.Finish: str = "完成"; break;
					case BillStatus.Proceed:
						if (bill_type == BillType.Deposit) {
							str = "提现中";
						} else if (bill_type == BillType.Refund) {
							str = "退款中";
						} else {
							str = "进行中";
						};
						break;
				}
				return str;
			}
		}
		/// <summary>
		/// 增加时间
		/// </summary>
		public DateTime create_time { get; set; }

		/// <summary>
		/// 支付信息id
		/// </summary>
		public long pay_id { get; set; }
		/// <summary>
		/// 支付信息
		/// </summary>
		public pay_info_dto pay_info { get; set; }
	}
}